﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Kimgwajang.MidnightPeach.Forms
{
    public partial class TemplateEditForm : Form
    {
        public TemplateEditForm()
        {
            InitializeComponent();
        }

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            rtb1.Rtf = @"{\rtf1\ansi\ansicpg949\deff0\deflang1033\deflangfe1042{\fonttbl{\f0\fnil\fcharset129 \'b1\'bc\'b8\'b2;}}
{\colortbl ;\red192\green0\blue0;\red255\green0\blue0;\red255\green192\blue0;\red148\green138\blue84;\red0\green112\blue192;\red112\green48\blue160;\red0\green176\blue80;}
\viewkind4\uc1\pard\lang1042\f0\fs18\par
}
";
        }

        private void button1_Click(object sender, EventArgs e)
        {
        }

        private string AddColorTable(string rtf)
        {
            int index = rtf.IndexOf("}}");
            return rtf.Insert(index + 2, @"{\colortbl ;\red192\green0\blue0;\red255\green0\blue0;\red255\green192\blue0;\red148\green138\blue84;\red0\green112\blue192;\red112\green48\blue160;\red0\green176\blue80;}");
        }

        private string AddColor(string text, int colorIndex)
        {
            return string.Format("{{\\b\\cf{0} {1}}}", colorIndex, text);
        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
